﻿<%@ Page Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master"
    AutoEventWireup="true" Inherits="SouthernLand.WebMaster.RaoVat.Default" CodeBehind="Default.aspx.cs" %>

<%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>

<%@ Register TagPrefix="southern" Namespace="SouthernLand.Common.BOL.NhaDat" Assembly="SouthernLand" %>

<%@ Register TagPrefix="southern" Namespace="SouthernLand.Common.Untilities" Assembly="SouthernLand" %>


<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" runat="Server">
    <uc:Title ID="Title1" runat="server" ResourceKey='' Text="Quản lý Tin rao" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <table align="center" width="700" cellpadding="0" cellspacing="0" border="0" style="table-layout: fixed">
                <tr>
                    <td>
                        <p class="Hidden" align="center">
                            <asp:Label runat="server" ID="lblMsg" Font-Size="Larger"></asp:Label></p>
                        <table width="700" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td align="left">
                                    <a class="linkAdd" href="<%=Globals.ApplicationPath %>WebMaster/Raovat/Dangtin.aspx">
                                        Đăng tin mới</a>
                                </td>
                                <td align="right">
                                    <span class="text">Search:</span>
                                    <southern:ddlCategories ID="dlLoaiBDS" ValidationGroup="w4u_Raovat" runat="server"
                                        Width="145" CssClass="Textbox" />
                                    <asp:TextBox runat="server" CssClass="textbox" ID="txtKeyword" Text=""></asp:TextBox>
                                    <asp:Button runat="server" ID="btSearch" OnClick="btSearch_Click" Text="Search" CssClass="Textbox" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="padding-top: 10px;">
                        <asp:GridView runat="server" Width="700" ID="GridViewItem" SkinID="GridView2">
                            <Columns>
                                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px"
                                    HeaderText="Delete">
                                    <HeaderTemplate>
                                        <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                            type="checkbox" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("RaovatID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="50" ItemStyle-Width="50" HeaderStyle-HorizontalAlign="center"
                                    ItemStyle-HorizontalAlign="center">
                                    <HeaderTemplate>
                                        <asp:LinkButton runat="server" CommandArgument="RaovatID" ID="RaovatID" Text="Mã"
                                            EnableTheming="false" OnClick="btSort_Click" />
                                        <%# GetImageSort((string)("RaovatID"))%>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a title="cssbody=[dvbdy1] cssheader=[dvhdr1] header=[Thông tin tin rao] body=[<%# GetThongKe((int)Eval("RaovatID"))%>]"
                                            href="<%=Globals.ApplicationPath %>WebMaster/Raovat/Dangtin.aspx?RaovatID=<%# Eval("RaovatID") %>">
                                            <%# Eval("RaovatID") %></a></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Title" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left">
                                    <HeaderTemplate>
                                        <asp:LinkButton runat="server" CommandArgument="Tieude" ID="Tieude" Text="Tiêu đề"
                                            EnableTheming="false" OnClick="btSort_Click" />
                                        <%# GetImageSort((string)("Tieude"))%>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a title="cssbody=[dvbdy1] cssheader=[dvhdr1] header=[Thông tin tin rao] body=[<%# GetThongKe((int)Eval("RaovatID"))%>]"
                                            href="<%=Globals.ApplicationPath %>WebMaster/Raovat/Dangtin.aspx?RaovatID=<%# Eval("RaovatID") %>">
                                            <%# Eval("Tieude") %></a>
                                        <%# GetImageVip((int)Eval("RaovatID"))%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="85" ItemStyle-Width="85" HeaderStyle-HorizontalAlign="center"
                                    ItemStyle-HorizontalAlign="center">
                                    <HeaderTemplate>
                                        <asp:LinkButton runat="server" ID="AddedDate" Text="Ngày đưa tin" EnableTheming="false"
                                            OnClick="btSort_Click" />
                                        <%# GetImageSort((string)("AddedDate"))%>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <span class="note">
                                            <%# Formatter.FormatDate((DateTime)Eval("AddedDate"))%>
                                        </span>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="85" ItemStyle-Width="85" HeaderStyle-HorizontalAlign="center"
                                    ItemStyle-HorizontalAlign="center">
                                    <HeaderTemplate>
                                        <asp:LinkButton runat="server" ID="ExpireDate" Text="Hết hạn" EnableTheming="false"
                                            OnClick="btSort_Click" />
                                        <%# GetImageSort((string)("ExpireDate"))%>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <%#(Convert.ToDateTime(Eval("ExpireDate")).Year==9999)? "" : Formatter.FormatDate((DateTime)Eval("ExpireDate"))%></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                <table align="center" width="300" border="0" bordercolorlight="#0099cc" bordercolor="#0099cc">
                                    <tr>
                                        <td height="50" align="center">
                                            <div align="center" id="EmptyData">
                                                Không có thông tin...</div>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <br />
                        <asp:Button runat="server" ID="btDelete" Text=" Delete " OnClick="btDelete_Click" /><br />
                        <br />
                        <br />
                    </td>
                </tr>
            </table>
            <div align="center">
                <asp:Panel ID="DisplayPager" Visible="True" runat="server">
                    <div align="center">
                        <table cellpadding="2" cellspacing="0" border="0" width="100%" align="center">
                            <tr>
                                <td valign="middle" align="center">
                                    <southern:Pager ID="Pager" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td valign="middle" align="center">
                                    <southern:CurrentPage id="CurrentPage" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <br />
</asp:Content>
